#!/bin/bash

# Check if three arguments are provided
if [ $# -ne 3 ]; then
    echo "Usage: $0 <original_zarr_name> <new_zarr_name> <embchar>"
    echo "Example: $0 original_data processed_data u"
    exit 1
fi

original=$1
new=$2
embchar=$3

# Create a copy of zarr_check.sh with actual values
sed "s/\$original/$original/g; s/\$new/$new/g; s/\$embchar/$embchar/g; s/\${embchar}/$embchar/g" zarr_check.sh > "zarr_check_${new}.sh"

# Make the new script executable
chmod +x "zarr_check_${new}.sh"

echo "Generated executable script: zarr_check_${new}.sh"
echo "You can now run: /mnt/workspace/gyh/utilgyh/zarr_check_${new}.sh" 